package com.javaweb.admin.controller;

import com.javaweb.admin.entity.kdltrans.KdlTransDto;
import com.javaweb.admin.entity.kdltrans.KdlTransVendor;
import com.javaweb.admin.query.KDLCustomerQuery;
import com.javaweb.admin.query.KdlTransVendorQuery;
import com.javaweb.common.utils.JsonResult;
import com.seegw.shaphar.IKDLService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/kdltrans")
public class KdlTransController {

    @Autowired
    IKDLService kdlService;

    @GetMapping("/index")
    public JsonResult index(KdlTransVendorQuery query){
        return kdlService.getTransVendorList(query);
    }

    @PostMapping("/savevendor")
    public JsonResult savevendor(@RequestBody KdlTransDto entity) {
        return kdlService.saveTransVendor(entity);
    }

    @GetMapping("/operdetail")
    public JsonResult operdetail(KdlTransVendorQuery query){
        return kdlService.getTransVendorOperList(query);
    }

    @GetMapping("/operlist")
    public JsonResult operlist(KdlTransVendorQuery query){
        return kdlService.getVendorOperListByName(query);
    }
    @GetMapping("/truckdetail")
    public JsonResult truckdetail(KdlTransVendorQuery query){
        return kdlService.getTransVendorTruckList(query);
    }

    @GetMapping("/trucklist")
    public JsonResult trucklist(KdlTransVendorQuery query){
        return kdlService.getVendorTruckListByName(query);
    }


}
